import request from '@/utils/request'

// 查询门类
export function getArchivesCategory(data) {
  return request({
    url: '/archive/list/query/category/list',
    method: 'post',
    params: data
  })
}

// 获取查询条件
export function getQueryList(data) {
  return request({
    url: '/archive/list/query/apply/list',
    method: 'post',
    data: data
  })
}

// 获取查询列
export function getShowList(data) {
  return request({
    url: '/archive/list/query/field/list',
    method: 'post',
    data: data
  })
}

// 查询接口
export function getSearchList(data) {
  return request({
    url: 'es/es/api/communal/search?state='+ data.state,
    method: 'post',
    data: data
  })
}

// 公共 -- 退回至个人库
export function editPublic(data) {
  return request({
    url: 'archive/da/library/remove/communal?gerenIds='+ data.gerenIds + '&typeState=' + data.typeState,
    method: 'put',
    data: data
  })
}

// 专题库查询列表
export function getSpecialList(data) {
  return request({
    url: 'es/es/api/communal/search?state='+ data.state + '&ztId='+ data.ztId,
    method: 'post',
    data: data
  })
}

// 专题库退回至个人库
export function editSpecial(id) {
  return request({
    url: 'archive/da/library/zt/remove/' + id,
    method: 'delete'
  })
}

// 个人库查询列表
export function getPersonList(data) {
  return request({
    url: 'es/es/api/communal/search?state=' + data.state,
    method: 'POST',
    data: data
  })
}

// 添加至专题库
export function addSpecial(data) {
  return request({
    url: 'archive/da/library/zt/add',
    method: 'post',
    data: data
  })
}

// 删除档案
export function deletePerson(id) {
  return request({
    url: 'archive/da/library/' + id,
    method: 'delete'
  })
}

// 新增到个人库
export function addPerson(data) {
  return request({
    url: 'archive/da/library',
    method: 'post',
    data: data
  })
}

// 添加至公共库
export function addPublic(data) {
  return request({
    url: 'archive/da/library/edit/communal?gerenIds='+ data.gerenIds + '&typeState=' + data.typeState,
    method: 'put',
    data: data
  })
}
